﻿using Obsidian.Edm;

/*============================
 * @author [#AUTHOR#]
 * @created [#CREATED#]
 * @desc 
* ============================ */

namespace [#QueryNS#]
{
	/// <summary>
	/// [#TbDescir#] 查询实体
	/// </summary>
	public class [#ClsName#]Qry : QueryInfo
	{
		public [#ClsName#]Qry()
		{
			base.InitModel(new IModelField[] {
				[#IdAlias#] = new [#IdType#](this, null , "[#IdAlias#]"),
				[#IdAlias#]s = new [#IdListType#](this, null , "[#IdAlias#]s",','),
				filtId = new  [#IdType#](this, null , "filtId"),
				filtIds = new [#IdListType#](this, null , "filtIds",','),
				keyword = new StringField(this, null , "keyword"),
				keywords = new StringListField(this, null , "keywords",','),
				enabled = new BoolField(this, null , "enabled"),
				startCreateDT = new DateDTField(this, null , "startCreateDT"),
				endCreateDT = new DateDTField(this,null,"endCreateDT"),
				startModifyDT = new DateDTField(this,null,"startModifyDT"),
				endModifyDT = new DateDTField(this, null , "endModifyDT"),
				orderBy = new OrderField(this, "orderBy", OrderByFields)
			});
		}

		#region [查询字段属性]

		private [#IdType#] [#IdAlias#];
		/// <summary>
		/// 记录ID（单个）
		/// </summary>
		public [#IdType#] [#IdName#] { get { return [#IdAlias#]; } }

		private [#IdListType#] [#IdAlias#]s;
		/// <summary>
		/// 记录ID字符串（多个，以英文逗号分隔）
		/// </summary>
		public [#IdListType#] [#IdName#]s { get { return [#IdAlias#]s; } }

		private [#IdType#] filtId;
		/// <summary>
		/// 过滤记录ID（单个）
		/// </summary>
		public [#IdType#] FiltId { get { return filtId; } }
		
		private [#IdListType#] filtIds;
		/// <summary>
		/// 过滤记录ID字符串（多个，以英文逗号分隔）
		/// </summary>
		public [#IdListType#] FiltIds { get { return filtIds; } }

		private StringField keyword;
		/// <summary>
		/// 关键字（单个）
		/// </summary>
		public StringField Keyword { get { return keyword; } }

		private StringListField keywords;
		/// <summary>
		/// 关键字字符串（多个，以英文逗号分隔）
		/// </summary>
		public StringListField Keywords { get { return keywords; } }

		private BoolField enabled;
		/// <summary>
		/// 记录状态：true:启用，false:禁用
		/// </summary>
		public BoolField Enabled { get { return enabled; } }

		private DateDTField startCreateDT;
		/// <summary>
		/// 创建：开始（日期）时间
		/// </summary>
		public DateDTField StartCreateDT { get { return startCreateDT; } }

		private DateDTField endCreateDT;
		/// <summary>
		/// 创建：结束（日期）时间
		/// </summary>
		public DateDTField EndCreateDT { get { return endCreateDT; } }

		private DateDTField startModifyDT;
		/// <summary>
		/// 修改：开始（日期）时间
		/// </summary>
		public DateDTField StartModifyDT { get { return startModifyDT; } }

		private DateDTField endModifyDT;
		/// <summary>
		/// 修改：结束（日期）时间
		/// </summary>
		public DateDTField EndModifyDT { get { return endModifyDT; } }
		
		private OrderField orderBy;
		/// <summary>
		/// 排序属性
		/// </summary>
		public OrderField OrderBy { get { return orderBy; } }

		/// <summary>
		/// 排序字段（根据实际情况自行修改）
		/// </summary>
		public const string OrderByFields = "[#IdAlias#],enabled,createDT,modifyDT";

		#endregion [查询字段属性]
	}
}